package com.media.utils;

import lombok.extern.slf4j.Slf4j;

import java.io.File;
import java.time.Duration;

/**
 * 工具类
 */
@Slf4j
public class ToolUtils {

    /**
     * 创建文件夹
     *
     * @param path 路径
     */
    public static void mkdirs(String path) {
        try {
            new File(path).mkdirs();
        } catch (Exception e) {
            log.error("创建文件夹 {} , 出现异常", path, e);
        }
    }

    /**
     * 等待指定时间
     *
     * @param millis 等待时间
     */
    public static void sleep(Long millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException e) {
            throw new RuntimeException("Sleep was interrupted", e);
        }
    }

}
